import os
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

# C:\Users\Administrator\AppData\Local\Google\Chrome\Application\chrome.exe --remote-debugging-port=9222 --user-data-dir="D:\chrome_temp"

# 打开浏览驱动器
chrome_options = Options()
chrome_options.add_experimental_option("debuggerAddress", "127.0.0.1:9222")
driver = webdriver.Chrome(options = chrome_options)
driver.implicitly_wait(3)

# 将浏览器最大化
driver.maximize_window()

# 获取当前目录的selen.html文件
file_path = os.path.join('file:///', os.getcwd(), "selenium.html")
driver.get(file_path)

# 定位元素并操作元素
checkbox1 = driver.find_element_by_css_selector('div#signup input[name="remeber"]')
checkbox2 = driver.find_element_by_css_selector('div#signup input[name="multi_login"]')

checkbox1.click()
checkbox2.click()

# 关闭浏览器
driver.quit()
